<?php

namespace common\models\folder;

use Yii;

/**
 * This is the model class for table "{{%member_data}}".
 *
 * @property int $id
 * @property string $member_id 会员ID
 * @property string $user_id 用户ID
 * @property string $realname 真实姓名
 * @property string $idcardno 身份证号
 * @property string $mobile 手机号
 * @property string $wechat_account 微信账户名
 * @property string $alipay_account 支付宝账户名
 * @property string $bank 开户行
 * @property string $bank_card_no 银行卡号
 * @property string $province
 * @property string $city
 * @property string $district
 * @property string $address
 * @property string $mark
 * @property string $created_at 创建时间
 * @property string $updated_at 更新时间
 * @property int $status 资料状态
 */
class MemberData extends \common\db\ActiveRecord {

    use \common\traits\Constants;

    CONST STATUS_ACTIVED = 1;
    CONST STATUS_DEFAULT = 0;
    CONST STATUS_DELETED = -1;

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%member_data}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['member_id', 'user_id', 'created_at', 'updated_at', 'status'], 'integer'],
            [['realname', 'idcardno', 'mobile', 'province', 'city', 'district', 'address'], 'required'],
            [['realname'], 'string', 'max' => 50],
            [['idcardno'], 'string', 'max' => 18],
            [['mobile'], 'string', 'max' => 11],
            [['wechat_account', 'alipay_account', 'bank', 'province', 'city', 'district'], 'string', 'max' => 64],
            [['bank_card_no'], 'string', 'max' => 30],
            [['address'], 'string', 'max' => 128],
            [['mark'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'member_id' => '会员ID',
            'user_id' => '用户ID',
            'realname' => '真实姓名',
            'idcardno' => '身份证号',
            'mobile' => '手机号',
            'wechat_account' => '微信账户名',
            'alipay_account' => '支付宝账户名',
            'bank' => '开户行',
            'bank_card_no' => '银行卡号',
            'province' => 'Province',
            'city' => 'City',
            'district' => 'District',
            'address' => 'Address',
            'mark' => 'Mark',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
            'status' => '资料状态',
        ];
    }

}
